//
//  WDNews.m
//  WDFans
//
//  Created by Zhihong Yuan on 2/8/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "WDNews.h"

@implementation WDNews

@synthesize newsTitle = newsTitle_;
@synthesize newsDescription = newsDescription_;
@synthesize newsImageUrl = newsImageUrl_;
@synthesize newsDate = newsDate_;
@synthesize newsContent = newsContent_;
@synthesize newsCover;

- (void)dealloc
{
    [newsCover release];
    [newsDate_ release];
    [newsTitle_ release];
    [newsDescription_ release];
    [newsImageUrl_ release];
    [newsContent_ release];
    [super dealloc];
}

#pragma NSCoding delegate
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:newsDate_ forKey:@"newsDate_"];
	[aCoder encodeObject:newsTitle_ forKey:@"newsTitle_"];
	[aCoder encodeObject:newsDescription_ forKey:@"newsDescription_"];
	[aCoder encodeObject:newsImageUrl_ forKey:@"newsImageUrl_"];
	[aCoder encodeObject:newsContent_ forKey:@"newsContent_"];
}

- (id)initWithCoder:(NSCoder *)aDecoder{
	if (self = [super init]){
        
		self.newsDate=[aDecoder decodeObjectForKey:@"newsDate_"];
		self.newsTitle=[aDecoder decodeObjectForKey:@"newsTitle_"];
		self.newsDescription=[aDecoder decodeObjectForKey:@"newsDescription_"];
		self.newsImageUrl=[aDecoder decodeObjectForKey:@"newsImageUrl_"];
		self.newsContent=[aDecoder decodeObjectForKey:@"newsContent_"];
        
	}
	return self;
}

@end
